<template>
  <div class="intro">
    <div v-if="dUserinfo.is_me">
      <textarea v-model="dUserinfo.intro"   style="width: 100%" rows="10" class="intro_content"></textarea>
      <span  class="btn btn-primary pull-right"   @click="saveIntro"> 保存</span>
      <slot name="isMe"></slot>
    </div>
    <div v-else>
      <div  v-html="'简介：'+intro(dUserinfo.intro)" class="intro_content"></div>
      <slot name="isNotMe"></slot>
    </div>

  </div>
</template>
<script>
export default {
  data(){
    return {
      dUserinfo:[],
    }
  },
  methods:{
    saveIntro(){
      let _this = this
      let options={
        intro:_this.dUserinfo.intro,
        id:_this.dUserinfo.uid
      }
      myjs.changeUserInfo(options,function(){
        _this.intro_edit=false
      },function(){
        alert('修改失败')
      })
    }
  },
  mounted() {
    this.dUserinfo = this.$store.getters.getUserinfo
  }
}
</script>
<style scoped>
textarea{border:1px solid #8C8B8B;margin: 0}
.intro{position: relative;width: 9.1rem;margin:.45rem;}
.intro_content{font-size: .32rem;text-indent: .64rem}
</style>
